import request from "@/request/request";
import requestMock from "@/request/requestMock";

// 请求一级分类列表
export const reqCategory1List = () => {
    return request.get(`/admin/product/getCategory1`);
};

// 请求二级分类列表
export const reqCategory2List = (category1Id) => {
    return request.get(`/admin/product/getCategory2/${category1Id}`)
}

// // 请求三级分类列表
export const reqCategory3List = (category2Id) => {
    return request.get(`/admin/product/getCategory3/${category2Id}`)
}

// 请求mock的banner数据
export const reqBannerList = () => {
    return requestMock.get(`/mock-api/banner`)
}


// 请求mock的floor数据
export const reqFloorList = () => {
    return requestMock.get(`/mock-api/floor`)
}

// 请求搜索页的数据
export const reqSearchList = (searchParams) => {
    return request.post(`/api/list`, searchParams);
};



//请求详情页数据
export const reqDetailList = (skuId) => {
    return request.get(`/api/item/${skuId}`);
};

// 添加购物车
export const reqAddOrUpdateCart = (skuId, skuNum) => {
    return request.post(`/api/cart/addToCart/${skuId}/${skuNum}`);
};

// 请求购物车列表
export const reqCartList = () => {
    return request.get(`/api/cart/cartList`)
}